﻿@model Web.Viewmodels.GamePropertiesViewModel

@helper DisplayHeuristic (KeyValuePair<string, string> heuristic)
{
    <div id="heuristic-item" class="row">
        <label>
            @Html.CheckBox(heuristic.Key, false)
            @Html.Raw(heuristic.Value)
        </label>
    </div> 
}

<div id="game-properties-content">
    <div id="game-type" class="row">
        @Html.EditorFor(m => Model.GameType)
    </div>

    <div id="time-control" class="row">
        @Html.EditorFor(m => Model.TimeControl)
    </div>

    <br/>

    <div id="player-properties" class="row">
        <div id="player1-properties" class="col-md-6">
            <div id="player1-player">
                <h4 style="font-weight: bold">Player</h4>
                @Html.EditorFor(m => Model.Player1Color, new {@class = "Player1Color"})
            </div>

            <div id="player1-ai" class="conceal-sub-section">
                <h4 style="font-weight: bold">AI</h4>
                @Html.EditorFor(m => Model.Player1Color, new {@class = "Player1Color"})

                @Html.EditorFor(m => Model.Player1Difficulty, new {SelectList = Model.PlayerDifficulty})

                @foreach (var heuristic in Model.Heuristics)
                {
                    @DisplayHeuristic(heuristic)
                }
            </div>
        </div>

        <div id="player2-properties" class="col-md-6">
            <h4 style="font-weight: bold">AI</h4>
            @Html.DisplayFor(m => Model.Player2Color)

            @Html.EditorFor(m => Model.Player2Difficulty, new {SelectList = Model.PlayerDifficulty})

            @foreach (var heuristic in Model.Heuristics)
            {
                @DisplayHeuristic(heuristic)
            }
        </div>
    </div>
</div>
@Scripts.Render("~/Scripts/newGame")
<script type="text/javascript">
    $(document).ready(function () {
        newGame.init();
    });
</script>
